const { defineConfig } = require("@vue/cli-service");
module.exports = defineConfig({
  transpileDependencies: true,

  outputDir: '../dist', // 构建文件保存在 Spring Boot 的静态资源目录中  
  assetsDir: 'dist', // 静态资源将存储在 static 文件夹  
  publicPath: '/',
  devServer: {
    port: 3000,
    proxy: {
      '/government': {
        target: 'http://localhost:8080',
        changeOrigin: true,
        ws: true,
        secure: false,
        onProxyReq: (proxyReq, req, res) => {
          proxyReq.setHeader('Accept', req.headers['accept']);
          proxyReq.setHeader('Cache-Control', 'no-cache');
          proxyReq.setHeader('Connection', 'keep-alive');
        },
        pathRewrite: {
          '^/government': '/api/government'
        }
      }
    }
  }
});